//{ allowMappedTypes: 'never' }
type Foo1<T> = {
  readonly [P in keyof T]: T[P];
};

type Foo2<T> =
  | {
  readonly [P in keyof T]: T[P];
}
  | {
  readonly [P in keyof T]: T[P];
};

